<!DOCTYPE html>
<html lang="en" class="app">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <link rel="stylesheet" href="Public/common/src/css/bootstrap.css" type="text/css"/>
    <link rel="stylesheet" href="Public/common/src/css/animate.css" type="text/css"/>
    <link rel="stylesheet" href="Public/common/src/css/app.css" type="text/css"/>
    <link rel="stylesheet" href="Public/common/src/css/font-awesome.min.css" type="text/css"/>

</head>
<body class="">
<section class="vbox">
    <section>
        <section class="hbox stretch">
            <!-- /.aside -->
            <section id="content">
                <section class="vbox">
                    <section class="scrollable padder">
                        <ul class="breadcrumb no-border no-radius b-b b-light pull-in">
                            <li><a href="{{U('Admin/Index/home')}}"><i class="fa fa-home"></i> 首页</a></li>
                            <li class="active">类型管理</li>
                        </ul>
                        <section class="panel panel-default">
                            <header class="panel-heading">
                                类型管理
                            </header>
                            <div class="row wrapper">
                                <div class="col-sm-4 m-b-xs">
                                    <a href="{{U('store')}}" class="btn btn-default btn-sm">添加类型</a>
                                </div>
                            </div>
                            <div class="table-responsive">
                                <table class="table table-striped b-t b-light">
                                    <thead>
                                    <tr>
									    <th>tid</th>
									    <th>类型名称</th>
									    <th width="210">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>                
                                    {{foreach from="$data['data']" key="$k" value="$v"}}                    
                                    <tr>
                                        <td>{{$v['ID']}}</td>
										<td>{{$v['tname']}}</td>
                                        <td>
                                            <div class="btn-group">
                                                <button data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">操作 <span class="caret"></span></button>
                                                <ul class="dropdown-menu dropdown-menu-right">
                                                	<li><a href="{{U('TypeAttr/index',array('tid'=>$v['ID']))}}">类型属性</a></li>
                                                	<li class="divider"></li>
                                                    <li><a href="{{U('edit',array('tid'=>$v['ID']))}}">编辑</a></li>
                                                    <li class="divider"></li>
                                                    <li><a href="javascript:onclick(del({{$v['ID']}}));">删除</a></li>
                                                </ul>
                                            </div>
                                        </td>
                                    </tr>
                                    {{endforeach}}
                                    </tbody>
                                </table>
                            </div>
							<div class="pagination pagination-sm pull-right">
								{{$data['page']}}
							</div>
                        </section>
                    </section>
                </section>
            </section>
        </section>
    </section>
</section>
<script src="Public/common/src/js/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="Public/common/src/js/bootstrap.js"></script>
<!-- 公共 -->
<script src="Public/common/js/common.js"></script>
<link rel="stylesheet" href="Public/common/css/common.css">

<script type="text/javascript">
			function del(tid)
			{
				if(confirm('确定删除吗?'))
				{
					$.post('{{U("del")}}',{tid:tid},function(data){
						if(data.code == 0)
						{
							setTimeout(function(){
								location.reload(true)
							},500)
						}else
						{
							alert(data.message)
						}
					});
				}
				
			}
		</script>
</body>
</html>